<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<table border="1" cellspacing="0" align="center" width="1000">
    <caption>
        <h3>User表信息</h3>&nbsp;<a href="form">添加</a>
    </caption>
    <thead>
    <tr>
        <th>id</th>
        <th>name</th>
        <th>pwd</th>
        <th>created_at</th>
        <th>updated_at</th>
        <th>operate</th>
    </tr>
    </thead>

    <tbody>
    @foreach($uqur as $k=>$u)
    <tr>
        <td>{{$k+1}}</td>
        <td>{{$u->name}}</td>
        <td>{{$u->pwd}}</td>
        <td>{{$u->created_at}}</td>
        <td>{{$u->updated_at}}</td>
        <td>
            <a href="form?id={{$u->id}}">编辑</a>
            <a href='javascript:del({{$u->id}})'>删除</a>
        </td>
    </tr>
    @endforeach
    </tbody>
</table>
<script>
    function del(id){
        var yesOrNo = window.confirm(" 你确定删除这条信息吗？ ");
        if(yesOrNo){
            location.href = "del?id="+id;
        }
    }
</script>
</body>
</html>
